﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BLFacade.entities;
using BLFacade;

namespace BL
{
    public partial class Customer : ICustomer
    {

        public List<ICustomerContacts> Contacts
        {
            get
            {
                return CustomerContacts.ToList<ICustomerContacts>();
            }
        }


        public ICustomerContacts CreateContact(string firstName, string middleName, string lastName, string email, string phoneNumber, string type, string username, string password)
        {
            CustomerContact contact = new CustomerContact()
            {
                Person = (Person)FacadeHolder.DataFacade.CreatePerson(firstName, middleName, lastName, email, phoneNumber, username, password),
                FirstName = firstName,
                MiddleName = middleName,
                LastName = lastName,
                Email = email,
                PhoneNumber = phoneNumber,
                Type = type,
                Customer = this,
            };
            CustomerContacts.Add(contact);
            return contact;
        }

        List<IProject> ICustomer.Projects
        {
            get
            {
                return Projects.ToList<IProject>();
            }
        }


        public IProject CreateProject(string name, string description, DateTime deadline, IEmployee manager)
        {
            Project project = new Project()
            {
                Name = name,
                Description = description,
                DeadLine = deadline,
                ProjectManager = manager,
                Customer = this
            };
            Projects.Add(project);
            return project;
        }
    }
}
